#ifndef TypesCommands_HPP
#define TypesCommands_HPP

enum eCommand
{
   COMMAND_INVALID = 0,
   COMMAND_ARDUINO_ONLINE,    // Arduino should send this command with some interval to show it is working
   COMMAND_ARDUINO_BTNSW_1,   // Arduino sends this command when Button_Switch_1 is pressed/released
   COMMAND_PC_ENGINE_FORWARD, // PC controls Engine 1 with this command
   COMMAND_PC_ENGINE_BACKWARD,// PC controls Engine 2 with this command
   COMMAND_PC_ENGINE_LEFT,    // PC controls Engine 3 with this command
   COMMAND_PC_ENGINE_RIGHT,   // PC controls Engine 4 with this command
   COMMAND_PC_NUMBER4 = 52,   // Some Dummy command
   COMMAND_MAX_VALUE          // Just dummy value - to count number of commands in this enum
};

enum eCommandSource
{
   COMMAND_SOURCE_INVALID = 0,
   COMMAND_SOURCE_ARDUINO,
   COMMAND_SOURCE_SOCKET
};

static const char* toString(const eCommand cmd)
{
   switch(cmd)
   {
      case COMMAND_ARDUINO_ONLINE:
         return "COMMAND_ARDUINO_ONLINE";
      case COMMAND_ARDUINO_BTNSW_1:
         return "COMMAND_ARDUINO_BTNSW_1";
      case COMMAND_PC_ENGINE_FORWARD:
         return "COMMAND_PC_ENGINE_FORWARD";
      case COMMAND_PC_ENGINE_BACKWARD:
         return "COMMAND_PC_ENGINE_BACKWARD";
      case COMMAND_PC_ENGINE_LEFT:
         return "COMMAND_PC_ENGINE_LEFT";
      case COMMAND_PC_ENGINE_RIGHT:
         return "COMMAND_PC_ENGINE_RIGHT";
      case COMMAND_PC_NUMBER4:
         return "COMMAND_PC_NUMBER4";
      case COMMAND_INVALID:
      default:
         return "COMMAND_INVALID";
   }
}

static eCommand toCommand(const int cmd)
{
   if (cmd >= COMMAND_MAX_VALUE || cmd < 0)
   {
      return COMMAND_INVALID;
   }
   
   return static_cast<eCommand>(cmd);
}

#endif // TypesCommands_HPP